package com.haidechizi.designpattern.strategy.simple;

/**
 * @author haidechizi
 */
public class Calculator {

    public static int calculate(int x, int y, String operate) {
        Calculate calculate = CalculateFactory.getInstance(operate);
        return calculate.calculate(x, y, operate);
    }

    public static void main(String[] args) {
        int calculate = Calculator.calculate(1, 2, "+");
        System.out.println(calculate);
        calculate = Calculator.calculate(1, 2, "*");
        System.out.println(calculate);
    }

}
